﻿<Page x:Class="Stankovita.Program.Pages.AddEditPages.AddEditOrders"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:Stankovita.Program.Pages.AddEditPages"
      mc:Ignorable="d" 
      d:DesignHeight="650" d:DesignWidth="850"
      Title="AddEditOrders">

    <Grid Background="WhiteSmoke">
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Grid Name="gridAddEditOrder"
              Grid.Row="1"
              Width="450"
              Height="400">

            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="60"/>
            </Grid.RowDefinitions>

            <!--Элементы в GroupBox-->
            <GroupBox Header="Добавление / Редактирование заказа"
                      FontSize="20"
                      BorderBrush="Black"
                      BorderThickness="2">

                <Grid Margin="10">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>

                    <!--Станок-->
                    <TextBlock Text="Станок"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <ComboBox Name="SelectMachineCmb"
                              Grid.Column="1"
                              SelectedItem="{Binding Manufactures}"
                              Margin="20"/>

                    <!--Заказчик-->
                    <TextBlock Grid.Row="1"
                               Text="Заказчик"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <ComboBox Name="SelectNameOrganizCmb"
                             Grid.Column="1"
                             Grid.Row="1"
                             SelectedItem="{Binding Customers}"
                             Margin="20"/>

                    <!--Дата заказа-->
                    <TextBlock Grid.Row="2"
                               Text="Дата заказа"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputDateOrderTxb"
                             Grid.Column="1"
                             Grid.Row="2"
                             Text="{Binding dateOrder}"
                             Margin="20"/>

                    <!--Количество-->
                    <TextBlock Grid.Row="3"
                               Text="Количество"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputAmountTxb"
                             Text="{Binding amount}"
                             Grid.Row="3"
                             Grid.Column="1"
                             HorizontalAlignment="Center"
                             Width="230"
                             VerticalAlignment="Center"
                             KeyDown="InputAmountTxb_KeyDown"/>
                    
                </Grid>

            </GroupBox>

            <!--Сохранение-->
            <Button Name="SaveOrderBtn"
                    Grid.Row="1"
                    Style="{DynamicResource ButtonStyle}"
                    Content="Сохранить"
                    FontSize="20"
                    Margin="10"
                    HorizontalAlignment="Center"
                    Width="200"
                    Click="SaveOrderBtn_Click"/>

        </Grid>

        <!--Вернуться на страницу -->
        <Button Name="BackBtn"
                Style="{DynamicResource ButtonStyle}"
                Content="Назад"
                FontSize="20"
                Margin="5" 
                Click="BackBtn_Click"/>
    </Grid>
</Page>
